﻿using System;
using System .Collections .Generic;
using System .Linq;
using System .Web;
using System .Data .Entity;
using System .ComponentModel .DataAnnotations;
using System .ComponentModel;
namespace VehicleManagement .Models
    {
    //    -------------------车辆信息表---------------------
    //CREATE	TABLE CarInfo
    //(
    //CarID int  IDENTITY(1,1) primary key,
    //Car_num varchar(18) UNIQUE not null ,
    //Car_type varchar(18) not null,
    //Pic varchar(100) not null,
    //Car_available bit default(0) not null,
    //Car_state varchar(4) not null, --可用、出车、维修
    //Remark  varchar(100)
    //)

    /// <summary>
    /// 车辆信息类
    /// </summary>
    public class CarInfo
        {
      
        public int CarID { get; set; }

        [DisplayName("车牌号码")]
        [Required(ErrorMessage = "车牌号不能为空")]
        [StringLength(100 , ErrorMessage = "车牌号长度不能超过18位")]
        public string CarNumber { get; set; }

        [DisplayName("车类型")]
        [Required(ErrorMessage = "车类型不能为空")]
        [StringLength(18 , ErrorMessage = "车类型长度不能超过18位")]
        public string CarType { get; set; }

        [DisplayName("车照片")]
       // [Required(ErrorMessage = "车照片不能为空")]
        [StringLength(18 , ErrorMessage = "车照片长度不能超过18位")]
        public string Picture { get; set; }

        [DisplayName("车是否可用")]
        [Required(ErrorMessage = "车是否可用不能为空")]
        public int CarAvailable { get; set; }


        [DisplayName("车状态")]
        [Required(ErrorMessage = "车状态不能为空")]
        [StringLength(6 , ErrorMessage = "车状态长度不能超过4位")]
        public string CarState { get; set; }

        [DisplayName("说明")]
        [StringLength(100 , ErrorMessage = "车状态长度不能超过100位")]
        public string Remark { get; set; }
        }

    //public class CarInfoDBContext :DbContext
    //{
    //    public DbSet<CarInfo>  CarInfos
    //        {
    //        get;
    //        set;
    //        }
    //    }
    }